﻿using NewChillers.Helpers;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace NewChillers.Utils
{
    public class IO_Address
    {
        [DllImport("msvcrt.dll")]
        public static extern int _getch();
        [DllImport("msvcrt.dll")]
        public static extern int _kbhit();
        //开关数组
        public static byte[] dataOn = new byte[8] { 1, 1, 1, 1, 1, 1, 1, 1 };
        public static byte[] dataClose = new byte[8] { 0, 0, 0, 0, 0, 0, 0, 0 }; 
        public static Int32 read_N = 0;

        private static string deviceNumber = ConfigHelper.GetString("IODEV");

        public static string strLineName_safetyDoorLock = deviceNumber + "/" + "port2" + "line0";//安全门锁
        public static string strLineName_emergencyStopButton = deviceNumber + "/" + "port0" + "line7";//紧急停止按钮
        public static string strLineName_powerOnButton = deviceNumber + "/" + "port0" + "line6";//开机按钮
        public static string strLineName_exhaust = deviceNumber + "/" + "port0" + "line5";//排气按钮
        public static string strLineName_start = deviceNumber + "/" + "port0" + "line4";//开始

        public static string strLineName_RedLight = deviceNumber + "/" + "port6" + "/" + "line0"; //红灯
        public static string strLineName_YellowLight = deviceNumber + "/" + "port6" + "/" + "line1"; //黄灯
        public static string strLineName_GreenLight = deviceNumber + "/" + "port6" + "/" + "line2"; //绿灯
        public static string strLineName_Buzz = deviceNumber + "/" + "port6" + "/" + "line3"; //蜂鸣器

        //电磁阀
        public static string strLineName_solenoidValve01 = deviceNumber + "/" + "port7" + "line0";//电磁阀1
        public static string strLineName_solenoidValve02 = deviceNumber + "/" + "port7" + "line1";//电磁阀2
        public static string strLineName_solenoidValve03 = deviceNumber + "/" + "port7" + "line2";//电磁阀3
        public static string strLineName_solenoidValve04 = deviceNumber + "/" + "port7" + "line3";//电磁阀4
        public static string strLineName_solenoidValve05 = deviceNumber + "/" + "port7" + "line4";//电磁阀5
        public static string strLineName_solenoidValve06 = deviceNumber + "/" + "port7" + "line5";//电磁阀6
        public static string strLineName_solenoidValve07 = deviceNumber + "/" + "port4" + "line0";//电磁阀7
        public static string strLineName_solenoidValve08 = deviceNumber + "/" + "port4" + "line1";//电磁阀8
        public static string strLineName_solenoidValve09 = deviceNumber + "/" + "port4" + "line2";//电磁阀9
        public static string strLineName_solenoidValve10 = deviceNumber + "/" + "port4" + "line3";//电磁阀10
        public static string strLineName_solenoidValve11 = deviceNumber + "/" + "port4" + "line4";//电磁阀11
        public static string strLineName_solenoidValve12 = deviceNumber + "/" + "port4" + "line5";//电磁阀12

        public static string strLineName_aaaa = deviceNumber + "/" + "port4" + "line6";//暂定
        public static string strLineName_aaa = deviceNumber + "/" + "port4" + "line7";//暂定

        public static string strLineName_mechanicalPump = deviceNumber + "/" + "port5" + "line0";//机械泵
        public static string strLineName_molecularPump = deviceNumber + "/" + "port5" + "line1";//分子泵

        public static string strLineName_electricValve01 = deviceNumber + "/" + "port5" + "line2";//电动阀01
        public static string strLineName_electricValve02 = deviceNumber + "/" + "port5" + "line3";//电动阀02
        public static string strLineName_electricValve03 = deviceNumber + "/" + "port5" + "line4";//电动阀03

        public static string strLineName_qqq = deviceNumber + "/" + "port5" + "line5";//暂定

    }
}
